import React, { Component } from 'react';
class Home extends Component {
    constructor(props) {
        super(props);
        this.state = {  };
    }
    componentDidMount(){
        const {location:{search}}=this.props;
        if(search === '?to=public'){
            console.log('请求接口public')
        }else if(search === '?to=about'){
            console.log('请求接口about')
        }else{
            console.log('请求个毛')
        }
    }
    render() {
        return (
           <h2>Home页面</h2> 
        );
    }
}

export default Home;